import request from '@/config/axios'

// 房间信息 VO
export interface RoomsVO {
  id: number // 主键
  name: string // 房间
  floor: string // 楼层
}

// 房间信息 API
export const RoomsApi = {
  // 查询房间信息分页
  getRoomsPage: async (params: any) => {
    return await request.get({ url: `/yyzx/rooms/page`, params })
  },

  // 查询房间信息详情
  getRooms: async (id: number) => {
    return await request.get({ url: `/yyzx/rooms/get?id=` + id })
  },

  // 新增房间信息
  createRooms: async (data: RoomsVO) => {
    return await request.post({ url: `/yyzx/rooms/create`, data })
  },

  // 修改房间信息
  updateRooms: async (data: RoomsVO) => {
    return await request.put({ url: `/yyzx/rooms/update`, data })
  },

  // 删除房间信息
  deleteRooms: async (id: number) => {
    return await request.delete({ url: `/yyzx/rooms/delete?id=` + id })
  },

  // 导出房间信息 Excel
  exportRooms: async (params) => {
    return await request.download({ url: `/yyzx/rooms/export-excel`, params })
  },
}